package com.wenx.ftpcamel;

import org.apache.camel.CamelContext;
import org.apache.camel.impl.DefaultCamelContext;
import org.apache.camel.main.Main;

public class MyFtpServer {

    private MyFtpServer() {
    }

    public static void main(String[] args) throws Exception {
        /*Main main = new Main();
        main.addRouteBuilder(new MyFtpServerRouteBuilder());
        main.run();*/

        CamelContext context = new DefaultCamelContext(); // 1. 创建 CamelContext.
        context.addRoutes(new MyFtpServerRouteBuilder());

        context.setTracing(true);
        context.start(); // 4. 启动CamelContext.
        Thread.sleep(Integer.MAX_VALUE);  // 为了保持CamelContext处于工作状态，这里需要sleep主线程
        context.stop(); // 最后停止CamelContext
    }
}
